package blog.entity;

import java.time.LocalDateTime;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;


//用户实体
public class User {
	private Integer userId;  //自增id 
	
	@NotNull(message = "用户名不能为NULL")
	@NotEmpty(message = "{name.not.empty}")  //不能是"" 这样的空
    private String userName; //账号  
	@NotNull(message = "密码不能为NULL")
	@Size(message = "密码长度必须在3-20之间",max = 20,min=3)
    private String userPass;  //密码
	@NotNull(message = "昵称不能为NULL")
	@Size(message = "昵称长度必须在2-10之间",max = 10,min=2)
    private String userNickname;  //昵称
	@NotNull(message = "邮箱不能为NULL")
	@Email(message = "{email.not.correct}")
    private String userEmail;  //邮箱
    private String userUrl;  //用户的网址
    private String userAvatar;  //指向一个图片地址(这个字段目前只是保留字段,暂时不用)
    private String userLastLoginIp;   //最后登录的IP
    private LocalDateTime userRegisterTime;   //用户注册的时间
    private LocalDateTime userLastLoginTime; //最后登录的时间
    private Integer articleCount; //用户发表的文章数量, 不是数据库字段 ,由计算得到
    private Integer userStatus; //用户的状态
    private byte [] userPhoto;  //用户照片,存的是具体的照片数据
    
	public Integer getUserId() {
		return userId;
	}
	public void setUserId(Integer userId) {
		this.userId = userId;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getUserPass() {
		return userPass;
	}
	public void setUserPass(String userPass) {
		this.userPass = userPass;
	}
	public String getUserNickname() {
		return userNickname;
	}
	public void setUserNickname(String userNickname) {
		this.userNickname = userNickname;
	}
	public String getUserEmail() {
		return userEmail;
	}
	public void setUserEmail(String userEmail) {
		this.userEmail = userEmail;
	}
	public String getUserUrl() {
		return userUrl;
	}
	public void setUserUrl(String userUrl) {
		this.userUrl = userUrl;
	}
	public String getUserAvatar() {
		return userAvatar;
	}
	public void setUserAvatar(String userAvatar) {
		this.userAvatar = userAvatar;
	}
	public String getUserLastLoginIp() {
		return userLastLoginIp;
	}
	public void setUserLastLoginIp(String userLastLoginIp) {
		this.userLastLoginIp = userLastLoginIp;
	}
	public LocalDateTime getUserRegisterTime() {
		return userRegisterTime;
	}
	public void setUserRegisterTime(LocalDateTime userRegisterTime) {
		this.userRegisterTime = userRegisterTime;
	}
	public LocalDateTime getUserLastLoginTime() {
		return userLastLoginTime;
	}
	public void setUserLastLoginTime(LocalDateTime userLastLoginTime) {
		this.userLastLoginTime = userLastLoginTime;
	}
	public Integer getUserStatus() {
		return userStatus;
	}
	public void setUserStatus(Integer userStatus) {
		this.userStatus = userStatus;
	}
	public byte[] getUserPhoto() {
		return userPhoto;
	}
	public void setUserPhoto(byte[] userPhoto) {
		this.userPhoto = userPhoto;
	}
	public Integer getArticleCount() {
		return articleCount;
	}
	public void setArticleCount(Integer articleCount) {
		this.articleCount = articleCount;
	}
}
